UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1edXrcvMgxQsdCX47/rXfcrwTUvxhP3G/3jPF8b0lPg='
WHERE
key_id = '48c541ab5988d15701641d76db762d04e8825966553238db33e60c5fc71c43fc'
AND (
token = '1edXrcvMgxQsdCX47/rXfcrwTUvxhP3G/3jPF8b0lPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)