UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Abx6n8CtXXqlHIzTQK+YMFhKuxMjKODSm50xhfM0CRo=' 
WHERE 
  key_id = '48c6d3ea12d6bcb1d1da9f67e7bac4af66b11ca3fb3068f04fdd9b67d1340773' 
  AND (
    token = 'Abx6n8CtXXqlHIzTQK+YMFhKuxMjKODSm50xhfM0CRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017