UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R2syLEqIhcWVo5RFHxwP7YhK9sr/W+DrUvJh3YQko/8=' 
WHERE 
  key_id = 'f179a659d6730f78b98db49a3b474bda1d414cd76c8cf3e2f75ddc3d453d4eda' 
  AND (
    token = 'R2syLEqIhcWVo5RFHxwP7YhK9sr/W+DrUvJh3YQko/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034