UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VnCwhzAjEn5J+nkZOJqHh5ETICqh8IoO8GZx9ZSnGrs=' 
WHERE 
  key_id = 'b18e586aa7eaf8fbcd08cbd6587166f94a02e4d79106635b74435776a7ba2269' 
  AND (
    token = 'VnCwhzAjEn5J+nkZOJqHh5ETICqh8IoO8GZx9ZSnGrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062