UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jowPosnUSaevv3WmkaH6kyilqDcNlCWrGw932EGTXlg='
WHERE
key_id = 'd4ac9e50b2f88db6b95114bdbfd44fb00cf341092298b888102675ebe2e558f8'
AND (
token = 'jowPosnUSaevv3WmkaH6kyilqDcNlCWrGw932EGTXlg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)