UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRbrYf74dE4EECq7v9dr+nI0R8eJPkddSQkNaLuoKuc=' 
WHERE 
  key_id = 'f4e6131bbdb642da0c80b872123aca9f1fe2043ae9ac80551ffde63f976b4c59' 
  AND (
    token = 'WRbrYf74dE4EECq7v9dr+nI0R8eJPkddSQkNaLuoKuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052