UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RWdhfIgv6vXspsLRI3AcDExsMwYwq1gGkPYkEnKRqVM='
WHERE
key_id = '656874f52611865ea604a1eb3fef51da2749d64c6932913bdf233b45f88da640'
AND (
token = 'RWdhfIgv6vXspsLRI3AcDExsMwYwq1gGkPYkEnKRqVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)