UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UwlX3knC9sJHXpxsf3reuVM9mEz7By9qDvsPjKtICgA=' 
WHERE 
  key_id = '656f8cd5b9c8f1cd6d638f8243f2e74d0f565b10510a478a6cdf87ccc29883bf' 
  AND (
    token = 'UwlX3knC9sJHXpxsf3reuVM9mEz7By9qDvsPjKtICgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043