UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SISJ76swroGE/ULBLBGNMdTiO0yeS9QAvvUVzUxwwyQ=' 
WHERE 
  key_id = '008a78f08e936d5f828b0be71c2f67f17ef0bbdfd5e1649f910dabac4466f630' 
  AND (
    token = 'SISJ76swroGE/ULBLBGNMdTiO0yeS9QAvvUVzUxwwyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037