UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm5nHqxye8d0/WF0Z5JWg/4NNoCKrGMeX1w6Edza/NDU=' 
WHERE 
  key_id = '3bd294a521dff43f2223b7a37a1282cb836985ebc0af33ee88506c19fb9a7e47' 
  AND (
    token = 'm5nHqxye8d0/WF0Z5JWg/4NNoCKrGMeX1w6Edza/NDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069