UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YUd+qWQoowL/k75Ak5CPIe16IdisKPdBzAucStlJf/0=' 
WHERE 
  key_id = '6ac34d5adc8602d428d99f03ea0142188eb4708f6592090561fb4e63e079c6a6' 
  AND (
    token = 'YUd+qWQoowL/k75Ak5CPIe16IdisKPdBzAucStlJf/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037