UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DylAe43ZVcLiQ9e/WyNMNhsm7Lcmvz8aGM0zruMhrqs='
WHERE
key_id = 'b5865e9913ef33e608611a82d2d76ca79b1109cd53a4a9a3197d2917ec0eb44e'
AND (
token = 'DylAe43ZVcLiQ9e/WyNMNhsm7Lcmvz8aGM0zruMhrqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)