UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/VziwauQ9XAR4eS2oIRkRfzH7xYFlw6uPOA9pwkJtAk='
WHERE
key_id = '09b803ae447281c5dc34e08033c4442c0df613572d9fb239561eee55376b4514'
AND (
token = '/VziwauQ9XAR4eS2oIRkRfzH7xYFlw6uPOA9pwkJtAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)