UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvs9bqQAy5isEOwtzdidhm7Idgiq/Zyk7C/fEyPkPM4=' 
WHERE 
  key_id = '88c2f03e39b6c6df62ef577667ff93890488aa54f5c20aaf9b6f6d9826e7ede9' 
  AND (
    token = 'dvs9bqQAy5isEOwtzdidhm7Idgiq/Zyk7C/fEyPkPM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054