UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9hIswzEmM/cvDlngQClxq4K05JNJFqU6j/UGu35wSc=' 
WHERE 
  key_id = 'd0c44f2fc12c72cc903a75c9651b4337c00edac4d77deaeffdbf7db5b61e0745' 
  AND (
    token = 'x9hIswzEmM/cvDlngQClxq4K05JNJFqU6j/UGu35wSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020