UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ddJcCD4K/EKi5IVT2yfRKuBKJO7PXA+YTnBHohdwCs='
WHERE
key_id = '93a4b3f269f2b1448a6f959f056e25cd7af1a6a9ea8b8831a30f899d897ebd4d'
AND (
token = '2ddJcCD4K/EKi5IVT2yfRKuBKJO7PXA+YTnBHohdwCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)