UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZLB9UFD2s7fDJUfAqX9umihg6SOV+7L6X9QR6/XIezw=' 
WHERE 
  key_id = '411bbc9b5cbb9d46e3f0715cd75d2dc109fd4deabe1bbe1dcb438c9b47994bb3' 
  AND (
    token = 'ZLB9UFD2s7fDJUfAqX9umihg6SOV+7L6X9QR6/XIezw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038