UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SIdnyJSHD1qSS5zFKZIvJ0SUXSql6Pp+BIQEAlKeAcM='
WHERE
key_id = '8fd02a415196848a5815f426c33b33fd1570829f446dd80eb163a14d71a9483e'
AND (
token = 'SIdnyJSHD1qSS5zFKZIvJ0SUXSql6Pp+BIQEAlKeAcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)