UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JTA8oTgMHVb1tLYixR+7EKWS3VZgUMdLwTTvHex7kMs=' 
WHERE 
  key_id = '8810628e55143257fb2544c1cea5edc41232c738749bb01614c7941ed6dcab27' 
  AND (
    token = 'JTA8oTgMHVb1tLYixR+7EKWS3VZgUMdLwTTvHex7kMs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033