UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ySWfKJEyCkBjQY2MfnAs2A8CXMQeVfM8scNNF1y/sbE=' 
WHERE 
  key_id = 'ea00aa1f15d46ade47b6f5faa3fd7bf0dad3c2e73445c074de513adc9cb3514b' 
  AND (
    token = 'ySWfKJEyCkBjQY2MfnAs2A8CXMQeVfM8scNNF1y/sbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029