UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B/Raa3Q1wg9YViZ4c/BhEKvdCosHdte1MKl3T9h5e4k=' 
WHERE 
  key_id = '3b738968dc612834fe9d8cda7dba7c810016453b4f6160efa3851c98038f77cb' 
  AND (
    token = 'B/Raa3Q1wg9YViZ4c/BhEKvdCosHdte1MKl3T9h5e4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033