UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't94wJqK5IQFBAaZ9b0MS7+Gc/Jwe5XsUMJqcTy6leFk='
WHERE
key_id = '87c9af5db16a0c777bddc2d1562d6ee0a64d9a22c4b4a6ad5d44a3b0718971c6'
AND (
token = 't94wJqK5IQFBAaZ9b0MS7+Gc/Jwe5XsUMJqcTy6leFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)