UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CbjUoobRxSDnMmrkhLkqNh8f0BcgTlrFiFyCb0MFd1o=' 
WHERE 
  key_id = '190d0716559a68a6b484b3cc425a1432323b3be850c564228e683f2aa0dd8127' 
  AND (
    token = 'CbjUoobRxSDnMmrkhLkqNh8f0BcgTlrFiFyCb0MFd1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033