UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TIucXiINLEtBI0x/+3XNvkAzkK8a0TLEOacCMNDwjVU=' 
WHERE 
  key_id = '5ffb3b68c57c30b4fa8324ad8bfd9bc9ae84f53b47ddc0a40041d0aa204644a4' 
  AND (
    token = 'TIucXiINLEtBI0x/+3XNvkAzkK8a0TLEOacCMNDwjVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039