UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2munCUbf+XYNF1IOCdGIPowJ7Gz8s3dkcvDKe9UJUMI='
WHERE
key_id = '8dca7d1ecf4b654500f3158f222c447a4507e326c969da31dc8f982fc76147c4'
AND (
token = '2munCUbf+XYNF1IOCdGIPowJ7Gz8s3dkcvDKe9UJUMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)