UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i8VBT8kpPuqfUFL85NfD1fItVEx+Pij0EgKL4xJ9gSQ='
WHERE
key_id = '425b45e555a17fe0d65de0cc30bd6df916b51e46d6e933c3670f22e7e7db03e0'
AND (
token = 'i8VBT8kpPuqfUFL85NfD1fItVEx+Pij0EgKL4xJ9gSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)