UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3iXWYnj8CHxP8Zp+wHggwuPBIn7kjfaV6rfjjbGenzQ='
WHERE
key_id = '3f83b79c0e7891ea28a15f1425075c51ec0793e376efd1792a00240ccc1c44a4'
AND (
token = '3iXWYnj8CHxP8Zp+wHggwuPBIn7kjfaV6rfjjbGenzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)