UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+qttbX0XuLJjqlsT3SbvACg87ixKPeJEUym5PRu1l38=' 
WHERE 
  key_id = 'e702574f7dc7fc7aa375a47b919c481420811c5e880f83ad946667361430a489' 
  AND (
    token = '+qttbX0XuLJjqlsT3SbvACg87ixKPeJEUym5PRu1l38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047