UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dn0YYYqkKJcMpqKteRlCZratPr/ONSvYyxz7dxeAPug='
WHERE
key_id = '0a0b1de4510a49ad05837dfea48fc614897f42396b3228f831b09c539860837c'
AND (
token = 'Dn0YYYqkKJcMpqKteRlCZratPr/ONSvYyxz7dxeAPug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)