UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r4tRf9D5za6ZFjXepNUDSIJCsEJ43sPftB8/FsyJpNQ='
WHERE
key_id = '6071f44cb57f1f60151e2cecffcd4a6572123cc87a718919a5523722658cf0fa'
AND (
token = 'r4tRf9D5za6ZFjXepNUDSIJCsEJ43sPftB8/FsyJpNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)