UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KXL+A4FMzfdqv9XvdSd0dC7swoCgCxtX9ix7lWx+u1s=' 
WHERE 
  key_id = '996351c0d9ae61b7c95558761d644f19e73850eecae4bdb1a4274fc6a859e4f3' 
  AND (
    token = 'KXL+A4FMzfdqv9XvdSd0dC7swoCgCxtX9ix7lWx+u1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024