UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GFtiIVxshAfs+DoS9lwHm+VgPGqe1ADbchz2rIELtKY='
WHERE
key_id = '48062f83a917cb5cd3c34169697a2e5307c5a602e6ba40153074773dfffe5099'
AND (
token = 'GFtiIVxshAfs+DoS9lwHm+VgPGqe1ADbchz2rIELtKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)