UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YIOzi65iS4WC1BfqDHmIj4Snl8Di8ey5PQy97oyRqBA=' 
WHERE 
  key_id = '92b21764606d703413ec06968ff333634040093dac76a5ce86d98aacd5bb4339' 
  AND (
    token = 'YIOzi65iS4WC1BfqDHmIj4Snl8Di8ey5PQy97oyRqBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031