UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5BXJHwfUV1ulCweXKNwnPcAQqoVS69Ts5XyTANW3X4g='
WHERE
key_id = '91b744b9c1165fbdafb64b65d7b018aa896111a989d024d80e3c2652ec2c2abe'
AND (
token = '5BXJHwfUV1ulCweXKNwnPcAQqoVS69Ts5XyTANW3X4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)