UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wUG5ziolUMiuqVIqjyOqHNj34VnAHhUImg+GB2g3c/4=' 
WHERE 
  key_id = '76fa32f78e6da7ca4f0cad9a4b2ca7ffdf93c4f7bce4a3308df2f23a5f5e45f5' 
  AND (
    token = 'wUG5ziolUMiuqVIqjyOqHNj34VnAHhUImg+GB2g3c/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038