UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60mhxsIdKxWs8v/KGMqO0cv9geRCXk3f+BJlP2tDRzw='
WHERE
key_id = 'c0aae424f359da67baffe4d2560042b25d01d3049bdb457ae4d053435230ae0c'
AND (
token = '60mhxsIdKxWs8v/KGMqO0cv9geRCXk3f+BJlP2tDRzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)