UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jjtjYGIgWGmn6/9cdTPoXy4DQOK00cZAPcAenvol1vE='
WHERE
key_id = 'fe13add68b00fcb98a8570b522644fe03dd6313c635c369df3f2224bcab36182'
AND (
token = 'jjtjYGIgWGmn6/9cdTPoXy4DQOK00cZAPcAenvol1vE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)