UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eL4oz+jXqk++x1wolnEZ1WVijVUuBmuwo/KpG6t/nRs=' 
WHERE 
  key_id = 'bb2cb15471440354fb808c6a45f115fdfeabe63f315ea38eae6682521359a266' 
  AND (
    token = 'eL4oz+jXqk++x1wolnEZ1WVijVUuBmuwo/KpG6t/nRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032