UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zppUK0x78tSj+OfKyah1swjc7qEjAR/Mc6uBZ3UOli0=' 
WHERE 
  key_id = 'cb6e7e453533cec46fd622a7df21e7f18c1ebe0c2e573197ea884e35159293de' 
  AND (
    token = 'zppUK0x78tSj+OfKyah1swjc7qEjAR/Mc6uBZ3UOli0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014