UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvVbDswaZrJWJUXfd3Wb7fdfsEg9TRZ7BzsTiP9S2oc=' 
WHERE 
  key_id = 'd4309b3de3d5c69e265dd9ae162314b60ed1c7511d0c51a554dacaf326e69e05' 
  AND (
    token = 'vvVbDswaZrJWJUXfd3Wb7fdfsEg9TRZ7BzsTiP9S2oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033