UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7/jsMNoKZsoYr6ax1BexbVHMLSfuE8ap0QguAlfyQcY='
WHERE
key_id = '92239a5fac177d14bf9b36fed8c8852e4f6fada604a7a7dc124c60a48c18ee50'
AND (
token = '7/jsMNoKZsoYr6ax1BexbVHMLSfuE8ap0QguAlfyQcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)