UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJ+yvhVamc30SrdiqqwaeAh/B7D4pf79nQrJnelzbME='
WHERE
key_id = '1f0f9462bfe0a847a59a0752d02efee4fdf5e972ec6fab3dadc068f527618651'
AND (
token = 'pJ+yvhVamc30SrdiqqwaeAh/B7D4pf79nQrJnelzbME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)