UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Slrit/2roc5h+aaeuepyVmobj0qKz50W/QU1gHuAckk='
WHERE
key_id = '279da1a1bb6df2deb15f48c6e2e803947ffe84390f721af0eec024addbcaa9f3'
AND (
token = 'Slrit/2roc5h+aaeuepyVmobj0qKz50W/QU1gHuAckk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)