UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kqxBgR5eK1UHl1iQIC5JPU6JFWSCqP+YI0PVB3cQg9g='
WHERE
key_id = 'eb663468b39a53180d5a42e17fdf7b667c685a6277e48baef111b9b91b2b74a7'
AND (
token = 'kqxBgR5eK1UHl1iQIC5JPU6JFWSCqP+YI0PVB3cQg9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)