UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P00Mdlz9TeDi7B8+YL7m8H1B600LwjWfnNS7yKo6ClU=' 
WHERE 
  key_id = '883ed7d6acac426bc73310dc3c803608c9ad2d04c10b984b4846a6122e0fefdd' 
  AND (
    token = 'P00Mdlz9TeDi7B8+YL7m8H1B600LwjWfnNS7yKo6ClU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029