UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VlYqGeSZSBytZ89LOMQMp11ec/DbSfk+UQkLHg1pifs=' 
WHERE 
  key_id = '0e37d57df3829918e023e9e6ca69aaba85d8ff7158afdae854db79454a6184a1' 
  AND (
    token = 'VlYqGeSZSBytZ89LOMQMp11ec/DbSfk+UQkLHg1pifs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028