UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ocnpVsAZVtivZ2r2ttAag2dbXZtftlJfpZuYFb8pLvg='
WHERE
key_id = '6a59d11a7ebb61e35e3f1c3b88911b05e4fb32d2e1a3cd0f772e68583205ffbb'
AND (
token = 'ocnpVsAZVtivZ2r2ttAag2dbXZtftlJfpZuYFb8pLvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)