UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n5Zz4hKIJ2vPrhzbL+y9hFeLIiJw/QeBuCBtm3KdM0k='
WHERE
key_id = 'bd7453d425c25ac105cbe04b4b3195f633e35af84268081da6d6ba5ab1bfc5fa'
AND (
token = 'n5Zz4hKIJ2vPrhzbL+y9hFeLIiJw/QeBuCBtm3KdM0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)