UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8T5PsdvaFUylqdpNXWZa9NwAdk55PzZJnGyAVmFBuns=' 
WHERE 
  key_id = '995802495bce7217e6bd9f9e501c3752864b75f1e9c4b0072da07b83fd17a6bf' 
  AND (
    token = '8T5PsdvaFUylqdpNXWZa9NwAdk55PzZJnGyAVmFBuns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040