UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zpgOW+1RXra3tAchE3g125fQ2axrFTzD7xK6Z131IfY=' 
WHERE 
  key_id = '0584e6cd5dfd101a4909370df57eb2288d791a84c2102b89a83d96cebe118360' 
  AND (
    token = 'zpgOW+1RXra3tAchE3g125fQ2axrFTzD7xK6Z131IfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016