UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GnjOkzRxR8GUSPyzR2CYrM5U9XEwl/QE6ioLGWsc0S0=' 
WHERE 
  key_id = 'cfe15e725553cff2a48577307e283ac2588a91d4d17f76a5f78f85cc37d68ed5' 
  AND (
    token = 'GnjOkzRxR8GUSPyzR2CYrM5U9XEwl/QE6ioLGWsc0S0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029