UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nGpCAaAUppWZ8gCq7Krurce167bKsXQC7NahJ4n035w=' 
WHERE 
  key_id = 'b6b93f68639565132c1a924362bf2e7ca9cd31b7da534dc9708c940e99b5d1ba' 
  AND (
    token = 'nGpCAaAUppWZ8gCq7Krurce167bKsXQC7NahJ4n035w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051