UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/qWtQ16g8VP6dCpUd1rMnEK9cDAY+frcbVK+l5t6Ybs=' 
WHERE 
  key_id = 'a93abd2056f3cd98a53e747276000c837411dba9bdfcd043cbd0ff612fc28759' 
  AND (
    token = '/qWtQ16g8VP6dCpUd1rMnEK9cDAY+frcbVK+l5t6Ybs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037