UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mauiUf+S8BLUf4icUbNn/0/CiSaj4P2rAhlRMQ865uE=' 
WHERE 
  key_id = '94d7ccd208745e33abd5975f75da8d754e23c37e082387cdab86b779196d044c' 
  AND (
    token = 'mauiUf+S8BLUf4icUbNn/0/CiSaj4P2rAhlRMQ865uE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026