UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RrygfQynNzhgrR8U1RaSmryfVZJGOPMF88IKGLxN/MQ=' 
WHERE 
  key_id = '0217e74302a8ef0979844b45261f5bcee4120fc1ba5971fc0cecf13eee7bbb31' 
  AND (
    token = 'RrygfQynNzhgrR8U1RaSmryfVZJGOPMF88IKGLxN/MQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031