UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '08veew9QMV0f3WgqnL/A97UKLgDTPDb+4z6Q4vgSMmQ=' 
WHERE 
  key_id = '5b398a33e2b7b1c9cfb94efa41b76df2e91ee23245c83118bc375f4f30540b2d' 
  AND (
    token = '08veew9QMV0f3WgqnL/A97UKLgDTPDb+4z6Q4vgSMmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032