UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZNItfAxmEb5LayE8g9ETMFwXR2A0+BbqILPDzxEwQQ=' 
WHERE 
  key_id = '83a6cf53e9efdb74fbee88952b35b1998a7fbc9c988954ae3d0cb3202456c1de' 
  AND (
    token = 'MZNItfAxmEb5LayE8g9ETMFwXR2A0+BbqILPDzxEwQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028