UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4DK/ozXRElEKrX76BhNWWbVTLSdf+TG+pXiqdSc/kBw=' 
WHERE 
  key_id = '0fd67ccedde86ec92aea0b2295f17fe57b50215e25b43ea5c9a6bd1b93e659d1' 
  AND (
    token = '4DK/ozXRElEKrX76BhNWWbVTLSdf+TG+pXiqdSc/kBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030