UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'px6vs7RKoiwFlhsv9qCHND3R0gyisc4kaIulMSH78cA=' 
WHERE 
  key_id = 'a484c804ddcf581ad1625b814fa887bf4a0d6b35053417c99a5469d6ef69be8e' 
  AND (
    token = 'px6vs7RKoiwFlhsv9qCHND3R0gyisc4kaIulMSH78cA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047