UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9qndZLRcW/Nu/cmMw82miTx/H2ij/mGV1nXM6MmhZ0Q='
WHERE
key_id = '500b684b19f78fc4c7d00394b133d43f344f3fe12c444e6ba9f3b0d83d0ad08e'
AND (
token = '9qndZLRcW/Nu/cmMw82miTx/H2ij/mGV1nXM6MmhZ0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)