UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6tPDPOTk5M3i6uYTvSAj+FEmC3u30raJpK+wOVFjmGE='
WHERE
key_id = '8c549d6f66913d2f1886c4a28764922c669f1941715271eafe0000153c69f063'
AND (
token = '6tPDPOTk5M3i6uYTvSAj+FEmC3u30raJpK+wOVFjmGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)