UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RZtPditwPpcgdeno+yD776zmRKIL3LLh7BXQ7B5zcMA=' 
WHERE 
  key_id = '99054711d3a25ece247298447c76ec756b5481db5a90f04063dd2dc4d7242fd1' 
  AND (
    token = 'RZtPditwPpcgdeno+yD776zmRKIL3LLh7BXQ7B5zcMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030