UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TgnGaC62ulUHBOMV1xGL5Pcqfo3jOHAJAO95yhxKXlY='
WHERE
key_id = '073ae63fecb613e4709db94d37326070875d4a097ec72146641f9bd4924129b5'
AND (
token = 'TgnGaC62ulUHBOMV1xGL5Pcqfo3jOHAJAO95yhxKXlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)