UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwxdC1wZvkkvRuMzeOSKTV2SDqswIHeJNrvcPSVcRcA='
WHERE
key_id = '1eb270f8334cca97ba0130842e6374a99bb7f421048f510944ce7a8e25602318'
AND (
token = 'fwxdC1wZvkkvRuMzeOSKTV2SDqswIHeJNrvcPSVcRcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)