UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4yfje8VjGNYPB/YHF6In6LaxnyGwKmlEdRizpv3/uBk=' 
WHERE 
  key_id = '5e88badb4e4a9e48e19b22f1955e6085fde27079cba4127d724153de6aa28592' 
  AND (
    token = '4yfje8VjGNYPB/YHF6In6LaxnyGwKmlEdRizpv3/uBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039