UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YbEfy5KEz302qpiiUCtwSQVDsxuM/C7G5sJ81JKfZlQ=' 
WHERE 
  key_id = '6367af8083fffbf1ecada20c6aad349751a0cde4929cc4f10bb0a50f30558d6e' 
  AND (
    token = 'YbEfy5KEz302qpiiUCtwSQVDsxuM/C7G5sJ81JKfZlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018