UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLckgFCu71JhVaBgwTQG1gXyWu9FmBGO62xyLGhVtaE='
WHERE
key_id = '53acbcd95f964bded5a6036a7e772ad0d724064e3889423614b6cd9bebf0e1e1'
AND (
token = 'iLckgFCu71JhVaBgwTQG1gXyWu9FmBGO62xyLGhVtaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)