UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qlcJ55VGcf7J0dHKAynchDdS8UjAoXCFsySbcfE3iGo='
WHERE
key_id = '8ee571ec5432961250a52a0f13fd8712a1b5154e549a5520982da8898d8e45a4'
AND (
token = 'qlcJ55VGcf7J0dHKAynchDdS8UjAoXCFsySbcfE3iGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)